home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_teo_drops.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  122 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEO_Drop.cog
  4. #
  5. # Raindrops in the cistern
  6. #
  7. # [SXC]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.     message     startup
  14.     message     crossed
  15.     message     pulse
  16.                 
  17.     sound       plunk0
  18.     sound       plunk1
  19.     sound       plunk2
  20.     sound       plunk3
  21.                 
  22.     surface     startsurf0      linkid=2
  23.     surface     startsurf1      linkid=2
  24.     surface     startsurf2      linkid=2
  25.     surface     startsurf3      linkid=2
  26.     surface     startsurf4      linkid=2
  27.                 
  28.     surface     stopsurf0       linkid=3
  29.     surface     stopsurf1       linkid=3
  30.     surface     stopsurf2       linkid=3
  31.     surface     stopsurf3       linkid=3
  32.     surface     stopsurf4       linkid=3
  33.     
  34.     thing       droppos0            
  35.     thing       droppos1            
  36.     thing       droppos2            
  37.     thing       droppos3            
  38.                 
  39.     thing       player          local
  40.     
  41.     template    waterrings=+ripples     local
  42.                 
  43.     int         pulsetime       
  44.     float       dropFreq        local
  45.     int         dropchannel     local
  46.     thing       droprings       local
  47.     vector      smallvec        local
  48.     vector      largevec        local
  49.     int         check           local
  50.         
  51. end
  52.  
  53. code
  54. # ........................................................................................
  55. startup:
  56.         player = GetLocalPlayerThing();
  57.         smallvec = VectorSet(0.01, 0.01, 1);
  58.         largevec = VectorSet(0.3, 0.3, 0);
  59.         return;
  60. # ........................................................................................
  61. crossed:
  62.         //print("hit crossed");
  63.         //printint(GetSenderID());
  64.         if ((GetSourceRef() == player) && (GetSenderID() == 2))
  65.         {
  66.                 check = 1;
  67.                 SetPulse(pulsetime);
  68.         }
  69.         else if ((GetSourceRef() == player) && (GetSenderID() == 3))
  70.         {
  71.                 SetPulse(0);
  72.                 StopSound(dropchannel, 1);
  73.         }                
  74.         return;
  75. # ........................................................................................
  76.  
  77. pulse:
  78.         dropFreq = Rand();
  79.         
  80.         if (GetThingFlags(player) & 0x2000000)
  81.         {
  82.         //print("player is underwater");
  83.         return;
  84.         }
  85.   
  86.         if (dropFreq < 0.16)
  87.         {
  88.                 dropchannel = PlaySoundLocal(plunk0, 0.4, 0, 0x0, 0);
  89.                 droprings = CreateThing(waterrings, droppos0);
  90.                 CaptureThing(droprings);
  91.                 AnimateSpriteSize(droprings, smallvec, largevec, 2);
  92.         }
  93.         
  94.         if ((dropFreq > 0.16) && (dropFreq < 0.32))
  95.         {
  96.                 dropchannel = PlaySoundLocal(plunk1, 0.4, 0, 0x0, 0);
  97.                 droprings = CreateThing(waterrings, droppos1);
  98.                 CaptureThing(droprings);
  99.                 AnimateSpriteSize(droprings, smallvec, largevec, 2);
  100.         }
  101.         
  102.         if ((dropFreq > 0.32) && (dropFreq < 0.48))
  103.         {
  104.                 dropchannel = PlaySoundLocal(plunk2, 0.4, 0, 0x0, 0);
  105.                 droprings = CreateThing(waterrings, droppos2);
  106.                 CaptureThing(droprings);
  107.                 AnimateSpriteSize(droprings, smallvec, largevec, 2);
  108.         }
  109.         
  110.         if ((dropFreq > 0.48) && (dropFreq < 0.64))
  111.         {
  112.                 dropchannel = PlaySoundLocal(plunk3, 0.4, 0, 0x0, 0);
  113.                 droprings = CreateThing(waterrings, droppos3);
  114.                 CaptureThing(droprings);
  115.                 AnimateSpriteSize(droprings, smallvec, largevec, 2);
  116.         }
  117.         
  118.         return;
  119.         
  120. end                                
  121.         
  122.